<template>
  <div>
    <div class="container">
      <div class="headerbox">
        <div class="header">
          <div class="searchbox">
            <router-link tag="div" to="FindView" class="search">
              搜索书名/作者
            </router-link>
            <router-link tag="div" to="/ShoppingCar" class="shopcar">
              <img src="../assets/img/ic_shop_cart.png" alt="">
            </router-link>
          </div>

          <!-- <div class="navbox">
            <ul>
              <li :class="{ con: tab == 0 }" href="" @click="get1(0)">推荐</li>
              <li :class="{ con: tab == 1 }" href="" @click="get1(1)">书单</li>
              <li :class="{ con: tab == 2 }" href="" @click="get1(2)">共读</li>
              <li :class="{ con: tab == 3 }" href="" @click="get1(3)">书讯</li>
              <li :class="{ con: tab == 4 }" href="" @click="get1(4)">话题</li>
            </ul>
          </div> -->
        </div>
      </div>

      <RecomView v-if="tab == 0" />
      <BooklistView v-if="tab == 1" />
      <CoreadingView v-if="tab == 2" />
      <BookNews v-if="tab == 3" />
      <TopicView v-if="tab == 4" />





    </div>
    <br>
    <br>
    <br>
    <br>
    
  </div>
</template>

<script>
import RecomView from '../components/RecomView.vue'
import BooklistView from '../components/BooklistView.vue'
import CoreadingView from '../components/CoreadingView.vue'
import BookNews from '../components/BookNews.vue'
import TopicView from '../components/TopicView.vue'

export default {
  data() {
    return {
      tab: 0
    }
  },
  components: {
    RecomView,
    BooklistView,
    CoreadingView,
    BookNews,
    TopicView
  },

  methods: {
   
    get1(i) {
      this.tab = i
    }
  },




}
</script>

<style lang="scss" scoped>
@import '../assets/css/base.css';

.headerbox {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  z-index: 100;
  background-color: #fff;
}

.header {
  padding-top: 12px;
  padding-bottom:12px;

  .searchbox {
    display: flex;

    .search {
      flex: 1;
      height: 45px;
      line-height: 45px;
      background: url(../assets/img/nav_ic_search.png) no-repeat;
      background-size: 45px;
      font-size: 16px;
      color: #a8b2c2;
      padding-left: 36px;
      background-color: #f6f6f6;
      border-radius: 50px;
      margin-left: 12px;
    }

    .shopcar {
      width: 30px;
      height: 30px;
      padding-right: 16px;
      padding-left: 16px;
      padding-top: 8px;

      img {
        width: 100%;
        height: 100%;
      }
    }
  }

  .navbox {
    height: 62px;
    line-height: 62px;
    font-size: 16px;


    ul {
      display: flex;
      justify-content: space-evenly;
      padding-top: 10px;
      li {
      color: #acb5c6;
      height: 40px;
      font-size: 16px;
      }

      .con {
        border-bottom: 5px solid #f5c265;
        padding-bottom: 8px;
        font-size: 20px;
        color: #000;
        font-weight: bold;
      }
    }
  }
}

.banner {
  padding: 12px;
  height: 150px;
  margin-top: 114px;

  img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
  }
}

.navbook {
  margin-top: 10px;
  display: flex;
  justify-content: space-around;

  .itembox {
    display: flex;
    align-items: center;
    flex-direction: column;

    img {
      width: 40px;
      height: 40px;
    }

    p {
      font-size: 16px;
      padding-top: 6px;
      color: #788190;
    }
  }
}

.bookbox {
  padding: 30px 12px;
  padding-bottom: 0px;

  .titlebox {
    display: flex;
    justify-content: space-between;
    align-items: baseline;

    p {
      font-size: 20px;
      color: #000;
      font-weight: bold;
    }

    .abox {
      display: flex;
      align-items: center;

      a {
        padding-right: 2px;
        font-size: 14px;
        color: #cdd2dc;

        i {
          width: 12px;
          height: 12px;
          background: url(../assets/img/icon_common_more.png) center center no-repeat;
          background-size: 100%;
          display: inline-block;
          margin-top: 4px;
        }
      }
    }
  }

  &:nth-child(5) {
    padding-top: 0px;
  }

  .B-hotbox {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;

    .hotbox {
      width: 88px;
      text-overflow: ellipsis;

      .img {
        width: auto;
        height: 114px;

        img {
          width: auto;
          height: 100%;
        }
      }

      .textbox {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
        width: 100%;
        color: #000;

        &:nth-child(3) {
          font-size: 13px;
          color: #9ba6ba;
        }
      }
    }
  }
}

.newbook {
  padding: 0 18px;
  margin-top: 22px;

  .book-box {
    display: flex;
    justify-content: space-between;
  }

  .imgbox {
    height: 170px;
    width: 88px;

    .img {
      width: auto;
      height: 120px;
      padding-right: 4px;

      img {
        width: auto;
        height: 100%;
      }
    }

    span {
      padding-top: 4px;
      font-size: 13px;
    }
  }
}

/* 畅销热门 */
/* .bookbox .B-hotbox .hotbox .textbox p{
    font-size: 13px;
}
.bookbox .B-hotbox .hotbox .textbox span{
} */
/* .bookbox .B-hotbox .hotbox  span{
}
.bookbox .B-hotbox .hotbox  p{
    overflow: hidden;
    text-overflow: ellipsis;
} */
.hot-banner {
  margin-top: 40px;
  margin-bottom: 46px;
  margin-left: 18px;
  margin-right: 18px;

  img {
    width: 100%;
    height: 240px;
  }
}
</style>